package com.weixin.portalweb.fegindemo;

import feign.Feign;
import feign.Request;
import feign.Retryer;
import feign.jackson.JacksonDecoder;
import feign.jackson.JacksonEncoder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: Jack
 * @create: 2019-11-27 10:18
 **/
@RestController
public class FeginContoller {

         UserClient userClient = Feign.builder()
                                  .decoder(new JacksonDecoder())
                                  .encoder(new JacksonEncoder())
                                  .options(new Request.Options(1000, 3500))
                                  .retryer(new Retryer.Default(5000, 5000, 3))
                                  .target(UserClient.class, "http://127.0.0.1:8080/");


    @RequestMapping("fegin")
    public String testFegin(){
      return  userClient.index();
    }



}
